
const room = {
  state: {
		//私聊select
    privateChatMap:{},
		privateChatArray:[],
		roompara:{},
		xmessager:null,
		priTips:false,
		allCount:0,
		roomLive:false,
		//上下麦直播判断
		roomChange:false,
		//上下麦loading
		micLoading:false,
		micIndex:0,
		micLoadingTimer:null,
		speaker:'',
		//上麦时间
		mictime:0,
		//当前播放流的索引
		currentHlsIndex:0,
		//聊天服务器参数
		wsparam:null,
		//房间播放器
		player:null,
		ws:null,
		loginModeOp:undefined
  },

  mutations: {
    SET_PRIVATECHATMAP(state,chatmap){
      state.privateChatMap = {...chatmap}
    },
		SET_PRIVATECHATARRAY(state,chatarr){
		  state.privateChatArray = chatarr
		},
		SET_ROOMPARA(state,obj){
			state.roompara = obj
		},
		SET_XMESSAGER(state,xmessager){
			state.xmessager = xmessager
		},
		SET_PRITIPS(state,tips){
			state.priTips = tips
		},
		SET_ALLCOUNT(state,allcount){
			state.allCount = allcount
		},
		SET_ROOMLIVE(state,roomlive){
			state.roomLive = roomlive
		},
		SET_ROOMCHANGE(state,roomchange){
			state.roomChange = roomchange
		},
		SET_MICINDEX(state,micIndex){
			state.micIndex = micIndex
		},
		SET_MICLOADING(state,loading){
			state.micLoading = loading
		},
		SET_MICLOADING_TIMER(state,timer){
			state.micLoadingTimer = timer
		},
		SET_SPEAKER(state,speaker){
			state.speaker = speaker
		},
		SET_MICTIME(state,time){
			state.mictime = time
		},
		SET_CURRENTHLSINDEX(state,index){
			state.currentHlsIndex = index
		},
		SET_WSPARAM(state,param){
			state.wsparam = param
		},
		SET_PLAYER(state,player){
			state.player = player
		},
		SET_WS(state,ws){
			state.ws = ws
		},
		SET_LOGIN_MODE_OP(state,loginModeOp){
			state.loginModeOp = loginModeOp
		}
  },

  actions: {
		//设置私聊
		setPrivateChatArr({ commit },arr){
			commit('SET_PRIVATECHATARR',arr)
		},
		setRoomPara({ commit },obj){
			commit('SET_ROOMPARA',obj)
		},
		setXmessager({ commit },xmessager){
			commit('SET_XMESSAGER',xmessager)
		},
		setPriTips({ commit },tips){
			commit('SET_PRITIPS',tips)
		},
		setAllCount({ commit },allcount){
			commit('SET_ALLCOUNT',allcount)
		}
  }
}

export default room